#!/usr/bin/python

import stockie.cli.common as common
from widgets import TwoColTable

common.setupEnv(globals())

usage = "Edit Stock"

parser = common.StockieOptionParser(usage=usage)
parser.add_posarg('stocksym', dest='symbol')
(options, args) = parser.parse_args()

info = interface.getStockInfo(options.symbol)

names = ['name', 'symbol', 'sector', 'quantity', 'current_price', 'stoploss', 'suggestion', 'ur_profit', 'r_profit']
labels = ['Name', 'Symbol', 'Sector', 'Quantity', 'Current Price', 'Stoploss', 'Suggestion', 'Profit(Unrealized)', 'Profit(Realized)']
t = TwoColTable(names, labels)
t.addRow(info)
t.render()

